import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'header',
      redirect: '/home',
      component: () => import('H/header'),
      children: [
        {
          path: '/home',
          name: 'Home',
          component: () => import('Ho/home')
        },
        {
          path: '/aricoal',
          name: 'aricoal',
          component: () => import('A/artical')
        },
        {
          path: '/aricoal/small',
          name: 'Articals',
          component: () => import('As/artical')
        },
        {
          path: '/home/notice',
          name: 'Notice',
          component: () => import('No/notic')
        },
        {
          path: '/home/shownotice',
          name: 'ShowNotice',
          component: () => import('@/pages/showNot/box')
        },
        {
          path: '/Myhome',
          name: 'Myhome',
          redirect: '/Myhome/article',
          component: () => import('My/home'),
          children: [
            {
              path: '/Myhome/article',
              name: 'Myarticle',
              component: () => import('My/components/content')
            }
          ]
        },
        {
          path: '/userCenter',
          name: 'CenterIntro',
          redirect: '/userCenter/user',
          component: () => import('@/pages/my_center/index'),
          children: [
            {
              path: '/userCenter/user',
              name: 'IndexMain',
              component: () => import('@/pages/my_center/components/components/main')
            },
            {
              path: '/userCenter/article',
              name: 'IndexArticle',
              component: () => import('@/pages/my_center/components/components/article')
            }
          ]
        }
      ]
    },
    {
      path: '/write',
      name: 'WriteArticol',
      meta: {
        requireAuth: true // 表示进入这个路由需要登录
      },
      component: () => import('W/write')
    },
    {
      path: '/writeOut',
      name: 'Artifin',
      component: () => import('@/pages/artifin/home')
    },
    {
      path: '/admins',
      name: 'admin',
      component: () => import('@/pages/admin/home')
    },
    {
      path: '/adminuser',
      name: 'adminUser',
      component: () => import('@/pages/admin/admin')
    },
    {
      path: '/adminuser/writegg',
      name: 'WriteGg',
      component: () => import('@/pages/admin/components/components/writeGg')
    },
    {
      path: '*', // 404 500
      name: 'InvalidWeb',
      component: () => import('@/pages/invalid/valid')
    }
  ]
})
